package com.eunion.web.admin.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.data.domain.Page;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.eunion.core.common.KvVo;
import com.eunion.core.common.ZtreeStringVo;
import com.eunion.web.admin.entity.AdminAuth;
import com.eunion.web.admin.jdbctemplate.AdminAuthJdbcTemplate;
import com.eunion.web.admin.repository.AdminAuthRepository;
import com.eunion.web.admin.service.AdminAuthService;
import com.eunion.web.common.base.BaseRepository;
import com.eunion.web.common.base.impl.BaseServiceImpl;

/**
 * @see AdminAuth.
 */
@Service(value = "adminAuthService")
@Transactional
public class AdminAuthServiceImpl extends BaseServiceImpl<AdminAuth, String> implements AdminAuthService {
 
 @Resource
 private AdminAuthRepository adminAuthRepository;
 
 @Resource
 private AdminAuthJdbcTemplate adminAuthJdbcTemplate;
 
 @Override
 public BaseRepository<AdminAuth, String> geBaseRepository() {
  return adminAuthRepository;
 }
 
 @Override
 public List<AdminAuth> findByAuthCodeOrAuthName(String authCode, String authName) {
  return adminAuthRepository.findByAuthCodeOrAuthName(authCode, authName);
 }
 
 @Override
 public List<KvVo> findAllAuths() {
  return adminAuthRepository.findAllAuths();
 }
 
 @Override
 public List<String> findAuthsByRoleCodes(List<String> roleCodes) {
  return adminAuthRepository.findAuthsByRoleCodes(roleCodes);
 }
 
 @Override
 public List<ZtreeStringVo> findAllAuthsForZtree() {
  return adminAuthRepository.findAllAuthsForZtree();
 }
 
 @Override
 public List<String> findAuths() {
  return adminAuthRepository.findAuths();
 }
 
 @Override
 public List<AdminAuth> findByParentAuthCode(String parentAuthCode) {
  return adminAuthRepository.findByParentAuthCode(parentAuthCode);
 }
 
 @Override
 public List<AdminAuth> getAllAdminAuth() {
  return adminAuthJdbcTemplate.getAllAdminAuth();
 }
 
}
